This allows the common XEN_DOMCTL_max_vcpus handler to lose some x86-specific
architecture knowledge.
It turns out that Xen had the same magic number twice in-tree with different
names (HVM_MAX_VCPUS and MAX_HVM_VCPUS). This removes all use of
MAX_HVM_VCPUS, and x86 uses HVM_MAX_VCPUS from the public headers.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
ret = -EINVAL;
if ( (d == current->domain) || /* no domain_pause() */
- (max > MAX_VIRT_CPUS) ||
- (is_hvm_domain(d) && (max > MAX_HVM_VCPUS)) )
+ (max > domain_max_vcpus(d)) )
break;
/* Until Xenoprof can dynamically grow its vcpu-s array... */
#endif
#define MAX_VIRT_CPUS 8
-#define MAX_HVM_VCPUS MAX_VIRT_CPUS
#define asmlinkage /* Nothing needed */
void vcpu_show_execution_state(struct vcpu *);
void vcpu_show_registers(const struct vcpu *);
+static inline unsigned int domain_max_vcpus(const struct domain *d)
+{
+ return MAX_VIRT_CPUS;
+}
+
#endif /* __ASM_DOMAIN_H__ */
/*
#define NR_CPUS 256
#endif
-/* Maximum we can support with current vLAPIC ID mapping. */
-#define MAX_HVM_VCPUS 128
-
/* Linkage for x86 */
#define __ALIGN .align 16,0x90
#define __ALIGN_STR ".align 16,0x90"
#include <asm/e820.h>
#include <asm/mce.h>
#include <public/vcpu.h>
+#include <public/hvm/hvm_info_table.h>
#define has_32bit_shinfo(d) ((d)->arch.has_32bit_shinfo)
#define is_pv_32bit_domain(d) ((d)->arch.is_32bit_pv)
unsigned int *ecx,
unsigned int *edx);
+#define domain_max_vcpus(d) (is_hvm_domain(d) ? HVM_MAX_VCPUS : MAX_VIRT_CPUS)
+
#endif /* __ASM_DOMAIN_H__ */
/*